<?php include ('database.php'); 
ob_start();
$tbl_name = "usersma";
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];

/*$db = new db();
$sql= "SELECT * FROM $tbl_name WHERE userName='$myusername' and pass='$mypassword'";
$result = $db->query($sql);

$count=mysql_num_rows($result);
echo $count;
if($count==1){
	session_register("myusername");
	session_register("mypassword");
	header("location:admin.php");
}
else{
	echo "wrong username or password";
}*/
if($myusername == 'secretword' && $mypassword == 'powertothepeople') {
	session_start();
	$_SESSION['views'] = 1;
	if(isset($_SESSION['views'])) {
		$_SESSION['myusername'] = $myusername;
		$_SESSION['mypassword'] = $mypassword;
		header("location:../admin.php");
	}
	else {
		echo "no session views";
	}
}else {
	echo "incorrect username and password";
}
ob_end_flush();
?>